package com.zhang.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.RequiredArgsConstructor;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author ZhangJunqi
 * @Date 2022/3/26 -10:06
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("user")
public class User {
    //主键：自增、UUID、雪花算法、redis、zookeeper

    //主键注解，默认全局ID：雪花算法
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;

    //非主键注解 还有插入、修改、查询策略，jdbcType和typeHandler等设置
    @TableField(value = "name",insertStrategy = FieldStrategy.NOT_EMPTY)
    private String name;
    @TableField("age")
    private Integer age;
    @TableField("email")
    private String email;
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    @Version
    private Integer version;

    @TableLogic
    private Integer deleted;
}
